package com.ctbri.io;

import java.util.HashMap;
import java.util.Map;

import com.ctbri.util.TextFile;

public class Ex17 {
	public static void main(String[] args) {
		TextFile textFile = new TextFile("C:/HPDIU.log");
		Map<Character, Integer> charCount = new HashMap<>();
		for(String line : textFile) {
			for(char c : line.toCharArray()) {
				Integer count = charCount.get(c);
				if(count == null)
					charCount.put(c, 1);
				else
					charCount.put(c, count + 1);
			}
		}
		System.out.println(charCount);
	}
}
